package com.git.dengchongshuang.managementsystem;

import java.util.Objects;

/**
 * @author DCSGO
 * @version 1.0
 * 联系人类
 */
public class Contact implements Cloneable{

    private String name;
    private String phoneNumber;
    private String email;
    private String job;
    //公司
    private String company;

    @Override
    protected Contact clone() throws CloneNotSupportedException {
        Contact rel = new Contact();
        rel.setName(this.name);
        rel.setPhoneNumber(this.phoneNumber);
        rel.setEmail(this.email);
        rel.setJob(this.job);
        rel.setCompany(this.company);
        return rel;
    }

    public Contact() {
    }

    public Contact(String name, String phoneNumber) {
        this.name = name;
        this.phoneNumber = phoneNumber;
    }

    @Override
    public String toString() {
        return "Contact{" +
                "name='" + name + '\'' +
                ", phoneNumber='" + phoneNumber + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Contact contact = (Contact) o;
        return Objects.equals(name, contact.name) && Objects.equals(phoneNumber, contact.phoneNumber);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, phoneNumber);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

}
